package com.code.day04.exceptions;

import java.io.FileNotFoundException;

public class Demo1 {
    public static void main(String[] args){
        String s = "abc.tx1t";
        try{
            int[] arr = null;
            System.out.println(arr.length);
            method(s);
        }catch(Exception e){
            e.printStackTrace();
        }

        System.out.println("sss");
    }

    public static void method(String s) throws FileNotFoundException {
        if(!s.endsWith(".txt")){
            throw new FileNotFoundException();
        }
    }
}
